package cn.zcf._06oneway2;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;

import java.nio.charset.StandardCharsets;

public class Producer6 {
    public static void main(String[] args) throws Exception {
        DefaultMQProducer producer = new DefaultMQProducer("oneway2-producer-group");
        producer.setNamesrvAddr("localhost:9876");
        producer.start();
        Message message = new Message("oneway2_topic", "hello_tags","少时诵诗书".getBytes(StandardCharsets.UTF_8));
        producer.sendOneway(message);

        producer.shutdown();
    }
}
